<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登录_人脉通</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <link rel="stylesheet" href="bitStyle/skin/main.css">
    <script src="bitStyle/skin/jquery-1.10.2.min.js"></script>
    <script src="bitStyle/skin/layer.js"></script><link rel="stylesheet" href="bitStyle/skin/layer.css" id="layui_layer_skinlayercss" style="">
    <script src="bitStyle/skin/foundation.js"></script>
    <script src="bitStyle/skin/my.js"></script>

    <script type="text/javascript" src="bitStyle/js/jquery.cookie.js"></script>
    
<script>
    $(function () {
        $('.checkbox-icon').on('click', function () {
            $(this).toggleClass('sel');
        })
        $('input').on('focus', function () {
            $(this).closest('div').css('border-color', '#20ac19');
        }).on('blur', function () {
            var $this = $(this);
            $this.closest('div').css('border-color', '#d1d1d1');
            setTimeout(function () { $this.closest('div').removeAttr('style'); }, 500);
        });
        $.removeCookie("alert", { path: '/' });
      checkRememberInfo();
    });

    //表单验证
    function ValidatorSubmit() {
        var txtName = $("#txtName").val();
        var txtPass = $("#txtPass").val();
        if (isNull(txtName)) {
            layer.msg("请输入手机号");
            $("#txtName").focus();
            return false;
        } else {
            if (!isMobile(txtName)) {
                layer.msg("手机号格式不正确");
                $("#txtName").focus();
                return false;
            }
        }

        if (isNull(txtPass)) {
            layer.msg("请输入密码");
            $("#txtPass").focus();
            return false;
        } else {
            if (!isPwd(txtPass)) {
                layer.msg("密码为6-16位任意字符");
                $("#txtPass").focus();
                return false;
            }
        }

        return true;
    }

    function submitLogin() {
        if (ValidatorSubmit()) {
            var param = {
                mobile: $("#txtName").val(),
                pwd: $("#txtPass").val(),
                isKeep: $('.checkbox-icon').hasClass('sel')
            }
            if($('.checkbox-icon').hasClass('sel')){
                //记住密码 存储本地
                rememberInfo();
            }else{
                //删除本地密码
                delInfo()
            }
            var i = layer.load(2);

            var account = $("#txtName").val();
            var password = $("#txtPass").val();
            $.post("/Home/Login/ajaxLogin.html",{account:account,password:password},function(data){
                layer.close(i);
                if(data.sf){
                    window.location.href = $('#CallBack').val();
                }else{
                    layer.msg(data.nr);
                }
            },'json');
        }
    }
  //记住密码
    function rememberInfo() {
        if(window.localStorage){
            var storage = window.localStorage;
            storage.setItem('acc',$("#txtName").val());
            storage.setItem('pas',$("#txtPass").val());
            storage.setItem('get',1);
        }
    }
    //记住密码
    function delInfo() {
        if(window.localStorage){
            var storage = window.localStorage;
            storage.clear();
        }
    }
    function checkRememberInfo() {
        if(window.localStorage){
            var storage = window.localStorage;
            var p = storage.getItem('get') == 1;
            if(p){
                $("#txtName").val(storage.getItem('acc'));
                $("#txtPass").val(storage.getItem('pas'));
                $(".checkbox-icon").addClass('sel');
            }
        }
    }
</script>

</head>
<body style="">
<div class="wrapper"><script>
    function back(){
        window.history.back();
    }
</script>
<style>
    .wrapper .mystyle{background-color:#6AA84F;text-align: center;font-weight: bold; color: #ffffff;
        padding: .4rem 3%; width: 94%; }
    .wrapper .mystyle img{float: left;  height: 100%; }
    .wrapper .notice,.article ,.joinfb,.w33,.my-friend001,.ljjcjj,.pt20,.swiper-container,.myforget,.myreg{margin-top: 1.8rem;}

    .weixin-set,.ewm{margin-top: 2.6rem;}
    .my-money001{margin-top: 2.2rem;}

</style>
<div class="header mystyle"><img onclick="back();" src="bitStyle/skin/back.png">人脉圈</div>
</div>
<div class="login">
    <div class="login-wrap">
        <div class="login-form">
            <div class="login-input">
                <i class="user-icon"></i>
                <input type="text" placeholder="请输入手机号" id="txtName" value="">
            </div>
            <div class="login-input">
                <i class="pwd-icon"></i>
                <input type="password" placeholder="请输入密码" id="txtPass" value="">
            </div>
            <div class="checkbox">
                <i class="checkbox-icon "></i>
                <span class="ot">记住密码</span>
            </div>
            <input class="submit-btn mt40" type="button" onclick="submitLogin();" value="立即登录">
            <input type="hidden" id="CallBack" value="/Home/Rmq/Index">
        </div>
    </div>
    <div class="other-btnwrap">
        <a href="/home/reg/index.html">立即注册</a> |
        <a href="/home/reg/forgot.html">忘记密码</a>
    </div>
</div>
</body></html>